import java.text.SimpleDateFormat;
import java.util.Date;

import javax.swing.JLabel;

class time  extends   Thread 
		{ 
		JLabel   label; 
		public time(JLabel   label) 
		{ 
		this.label=label; 
		} 
		public   void   run() 
		{ 
		try   { 
		        while(true){ 
		        	SimpleDateFormat   sdf   =   new   SimpleDateFormat( "yyyy-MM-dd hh:mm:ss "); 
		        		label.setText(sdf.format(new   Date())); 
		        		sleep(1000); 
		        	} 
		       }catch   (Exception   ex)   { 
		    	   ex.printStackTrace(); 
		       } 
		}
}